print("Example script zs_wuqi.lua.");


local Duanjin = CLASS(Spell)
Duanjin.name = '断筋'
Duanjin.target = 'target'

function Duanjin:canCast( )
	local t = getDebuffRemainTime( self.target, '断筋')
	return t < 1
end
local LeiTingYiJi = CLASS(Spell)
LeiTingYiJi .name = '雷霆一击'
function LeiTingYiJi:canCast( )
	return IsSpellInRange('破胆怒吼', 'target') == 1
end

local ChongFeng = CLASS(Spell)
ChongFeng.name = '冲锋'
ChongFeng.target = 'target'
function ChongFeng:canCast( )
	local start, duration, enabled = GetSpellCooldown("英勇飞跃");
 	local dt = GetTime() - start
	return  dt > 1
end
local KuangNuHuiFu = CLASS(Spell)
KuangNuHuiFu .name = '狂怒回复'
function KuangNuHuiFu:canCast( )
	return getHpParent('player') < 0.8
end
local JiJieNaHan = CLASS(Spell)
JiJieNaHan .name = '集结呐喊'
function JiJieNaHan:canCast( )
	return getHpParent('player') < 0.3
end
local YingYongDaJi = CLASS(Spell)
YingYongDaJi.name = '英勇打击'
YingYongDaJi.target = 'target'
YingYongDaJi.continue = true
function YingYongDaJi:canCast( )
	local _, n = getBuffRemianTime('player',"不屈打击");
	return n >= 3 or getBuffRemianTime('player', '最后通牒') > 0 or UnitPower('player') >  70
	-- return not s.dunxi or n > 4
end

local DunPaiPingZhang = CLASS(Spell)
DunPaiPingZhang.name = '盾牌屏障'
DunPaiPingZhang.continue = true
function  DunPaiPingZhang:canCast()
	return getBuffRemianTime('player','盾牌屏障') == 0
	-- return true
end

local HuiMieDaJi = CLASS(Spell)
HuiMieDaJi.name = '毁灭打击'
HuiMieDaJi.target = 'target'
function HuiMieDaJi:canCast( )
	return getDebuffRemainTime('target',"重伤") == 0;
end

local DunPaiChongFeng = CLASS(Spell)
DunPaiChongFeng.name = '盾牌冲锋'
DunPaiChongFeng.target = 'target'
function DunPaiChongFeng:canCast( )
	return getBuffRemianTime('player',"盾牌冲锋") == 0;
end

local JiaoDouZhan = CLASS(Scheme)
-- WuQiZhan.follow = true
function JiaoDouZhan:ctor( )
	self:addSpell(Spell.new('乘胜追击', 'target'))
	self:addSpell(KuangNuHuiFu.new())
	self:addSpell(ChongFeng.new())
	self:addSpell(JiJieNaHan.new())
	-- self:addSpell(DunPaiPingZhang.new())
	-- self:addSpell(DunPaiChongFeng.new())
	self:addSpell(YingYongDaJi.new())
	self:addSpell(HuiMieDaJi.new())
	self:addSpell(Spell.new('斩杀', 'target'))
	self:addSpell(Spell.new('盾牌猛击', 'target'))
	self:addSpell(Spell.new('复仇', 'target'))
	self:addSpell(Spell.new('毁灭打击', 'target'))
	self:addSpell(Spell.new('猛击', 'target'))

	self:addInterruptSpell(Spell.new('拳击', 'target'))

	self:addToggleSpell(DunPaiPingZhang.new())
	-- self.slowSpell = Duanjin.new()
	-- self.slowSpell = LeiTingYiJi.new()
	--self:addInterruptSpell(Spell.new('风暴之锤'))
	--self:addInterruptSpell(Spell.new('法术反射'))
	--self:addInterruptSpell(Spell.new('破胆怒吼'))
end

schemeMap[13] = JiaoDouZhan.new()
